package com.svse.designPattern.behaviour.state.impl;

import com.svse.designPattern.behaviour.state.context.ScoreContext;
import com.svse.designPattern.behaviour.state.service.AbstractState;

/**
 * @author LiYuhang
 * @version 0.1
 * @application
 * @Date 2020/8/8 11:29
 */
public class MiddleState  extends AbstractState {

    public MiddleState(AbstractState state)
    {
        context=state.context;
        stateName="中等";
        score=state.score;
    }
    @Override
    public void checkState() {
        if(score<60){
            context.setAbstractState(new LowState(this));
        } else if(score>=90)
        {
            context.setAbstractState(new HighState(this));
        }
    }
}
